﻿namespace NetFx.MSIL
{
  using System;
  using System.Text;
  using System.Threading;
  using System.Collections;

  using System.Reflection;
  using System.Reflection.Emit;

  public class LabelGenerator:AnyGenerator
  {
    #region Statics
    public static LabelGenerator of(string name, long address, Label label)
    {
      return new LabelGenerator(name, address, label);
    }
    #endregion
    #region Fields
    protected string name = string.Empty;
    protected long address = 0;
    protected Label label;
    #endregion
    #region Properties
    public override object AnyBuilder
    {
      get { return this.label; }
    }
    public override DefType GeneratorType
    {
      get
      {
        return DefType.Label;
      }
    }
    public virtual Label Label
    {
      get
      {
        return this.label;
      }
    }
    public virtual string Name
    {
      get
      {
        return this.name;
      }
      set
      {
        this.name = value;
      }
    }
    public virtual long Address
    {
      get
      {
        return this.address;
      }
      set
      {
        this.address = value;
      }
    }
    #endregion
    #region Constructors
    public LabelGenerator(string name, long address, Label label)
    {
      this.name = name;
      this.address = address;
      this.label = label;
    }
    #endregion
    #region Utils
    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
        this.name = null;
      }
      base.Dispose(disposing);
    }
    #endregion
  }
}
